
var jsonList = {};
var page = 1;
var rows = 10;
$(function(){
//     $(".user_span em").off("click").on("click",function(){
//        var index = $(this).index();
//     $(this).addClass("on").siblings().removeClass("on");
//        $(".user_gly_big .user_gly").eq(index).addClass("active").siblings().removeClass("active");
//      });
    getList();
});
function  getList(){
var result = JSON.stringify(jsonList);
$.ajax({
    url: baseNews + "/api/data/common/user/login/log?page=" + page + "&rows=" + rows,
    type: "post",
    headers: { 'Content-Type': 'application/json' },
    dataType: "json",
    data: result,
    success: function (res) {
        console.log(result, 666);
        if (res.code == 0) {
            var result = res.data;
            var list = result.list;
            console.log(list, 9999)
            var html = "";
            $("#page").paging({
                pageNo: page,
                totalPage: result.totalpage,
                totalSize: result.totals,
                callback: function (num) {
                    page = num;
                    getList();
                }
            })
            $(".user_list").empty();
            $(list).each(function (index, key) {
                html += `<ul >
                        <li>${key.ip}</li>
                       
						<li>${key.username}</li>
						<li>${getLocalTime(key.time/1000)}</li>
					</ul>`;
            })
            $(".user_list").append(html);
        }
    }
})
}
function getLocalTime(nS) {
    return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/, ' ');
}